home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / winanim.zip / ANIM.H < prev    next >
C/C++ Source or Header  |  1991-11-18  |  6KB  |  192 lines

  1. /***************************************************************************
  2. *                                                                                                    *
  3. *                         Header file for use with WANIM.DLL                            *
  4. *                                                                                                    *
  5. *                             Copyright (c) 1991 Louis X. Savain                            *
  6. *                                                                                                    *
  7. *                                     AND-XOR Systems                                            *
  8. *                                                                                                    *
  9. * TAB = 3                                                                                        *
  10. *                                                                                                    *
  11. ****************************************************************************/
  12.  
  13. #ifndef __WANIM__
  14. #define __WANIM__
  15.  
  16.  
  17. /************************* TYPE DEFINITIONS ********************************/
  18.  
  19. typedef HANDLE HAC;                    /* animation context handle */
  20. typedef HANDLE HANIMOB;                /* animation object handle */
  21. typedef HANDLE HAZ;                    /* animation zone handle */
  22.  
  23.  
  24. /* This typedef defines a callback function.  It is used when creating
  25.     algorithmic and combination animobs. */
  26.  
  27. typedef void (FAR PASCAL *ALGOPROC)(HDC hDC, RECT FAR *lpRect);
  28.  
  29.  
  30.  
  31. /******************* ANIMATION FUNCTION PROTOTYPES *************************/
  32.  
  33.  
  34. BOOL         FAR PASCAL  AnimobAlive(HANIMOB hAnimob);
  35.  
  36. BOOL        FAR PASCAL  AnimobCollide(HANIMOB hAnimob1,
  37.                                               HANIMOB hAnimob2);
  38.  
  39. BOOL        FAR PASCAL  AnimobRectCollide(HANIMOB hAnimob, RECT FAR *lpRect);
  40.  
  41. BOOL        FAR PASCAL  AttachAnimob(HAZ hAZ, HANIMOB hanimob);
  42.  
  43. HANIMOB    FAR PASCAL  CreateAlgoAnimob(int nWidth,
  44.                                                   int nHeight,
  45.                                                   int nPriority,
  46.                                                   ALGOPROC lpProc);
  47.  
  48. HAC        FAR PASCAL  CreateAnimContext(HDC hDC,
  49.                                                     int nWidth,
  50.                                                     int nHeight);
  51.  
  52. HAZ        FAR PASCAL  CreateAnimZone(HAC hAC,
  53.                                                 HBITMAP hbmZone,
  54.                                                 int x, int y,
  55.                                                 int nClipLeft,
  56.                                                 int nClipTop,
  57.                                                 int nClipWidth,
  58.                                                 int nClipHeight);
  59.  
  60. HANIMOB    FAR PASCAL  CreateBitmapAnimob(HBITMAP hbmImage,
  61.                                                      HBITMAP hbmMask,
  62.                                                      int nPriority);
  63.  
  64. HANIMOB    FAR PASCAL  CreateCombAnimob(HBITMAP hbmImage,
  65.                                                   HBITMAP hbmMask,
  66.                                                   int nPriority,
  67.                                                   ALGOPROC lpProc);
  68.  
  69. HBITMAP    FAR PASCAL  CreateMask(HDC hDC,
  70.                                           HBITMAP hbmImage,
  71.                                           COLORREF crTransColor);
  72.  
  73. HBITMAP    FAR PASCAL     CreateMaskXY(HDC hDC,
  74.                                              HBITMAP hbmImage,
  75.                                              int x,
  76.                                              int y);
  77.  
  78. HAZ        FAR PASCAL  DeriveAnimZone(HDC hDC,
  79.                                                 HAC hAC,
  80.                                                 RECT FAR *lpRect);
  81.  
  82. BOOL        FAR PASCAL  DetachAnimob(HANIMOB hAnimob);
  83.  
  84. void        FAR PASCAL  DisplayAnimob(HANIMOB hAnimob, int x, int y);
  85.  
  86. void        FAR PASCAL  EraseAnimob(HANIMOB hAnimob);
  87.  
  88. void         FAR PASCAL  EraseAnimobBitmap(HDC hDC,
  89.                                                     HANIMOB hAnimob,
  90.                                                     int x,
  91.                                                     int y);
  92.  
  93. void        FAR PASCAL  FreeAnimob(HANIMOB hAnimob);
  94.  
  95. void        FAR PASCAL  FreeAnimobStruct(HANIMOB hAnimob);
  96.  
  97. void        FAR PASCAL  FreeAnimContext(HAC hAC);
  98.  
  99.  
  100. void        FAR PASCAL  FreeAnimZone(HAZ hAZ);
  101.  
  102. void         FAR PASCAL  GetAnimobPos(HANIMOB hAnimob, POINT FAR *lpPoint);
  103.  
  104. WORD        FAR PASCAL  GetLastWanimError(void);
  105.  
  106. void        FAR PASCAL  ModifyAnimZoneClip(HAZ hAZ,
  107.                                                      int nClipLeft,
  108.                                                      int nClipTop,
  109.                                                      int nClipWidth,
  110.                                                      int nClipHeight);
  111.  
  112. void        FAR PASCAL  MoveAlgoAnimate(HANIMOB hAnimob,
  113.                                                  int nWidth,
  114.                                                  int nHeight,
  115.                                                  int nDeltaX,
  116.                                                  int nDeltaY);
  117.  
  118. void        FAR PASCAL  MoveAnimate(HANIMOB hAnimob,
  119.                                             HBITMAP hbmImage,
  120.                                             HBITMAP hbmMask,
  121.                                             int nDeltaX,
  122.                                             int nDeltaY);
  123.  
  124. void        FAR PASCAL  MoveAnimob(HANIMOB hAnimob,
  125.                                           int nDeltaX,
  126.                                           int nDeltaY);
  127.  
  128. void        FAR PASCAL  ModifyAnimZoneLoc(HAZ hAZ, int x, int y);
  129.  
  130. void        FAR PASCAL  NewAnimZoneBitmap(HAZ hAZ, HBITMAP hbmZone);
  131.  
  132. void         FAR PASCAL  PaintAnimobBitmap(HDC hDC,
  133.                                                     HANIMOB hAnimob,
  134.                                                     int x,
  135.                                                     int y);
  136.  
  137. void        FAR PASCAL  PaintAnimZone(HDC hDC, HAZ hAZ);
  138.  
  139. void        FAR PASCAL  RefreshAnimZone(HDC hDC, HAZ hAZ);
  140.  
  141. void        FAR PASCAL    ResetAnimobPriority(HANIMOB hAnimob,
  142.                                                       int nPriority);
  143.  
  144. void        FAR PASCAL    ResetAnimobProc(HANIMOB hAnimob,
  145.                                                  ALGOPROC lpProc);
  146.  
  147. void         FAR PASCAL _export RestoreRect(HDC hDC,
  148.                                                      HAZ hAZ,
  149.                                                      RECT FAR *lpRect);
  150.  
  151. void         FAR PASCAL  SetAnimobFrame(HANIMOB hAnimob,
  152.                                                 HBITMAP hbmImage,
  153.                                                 HBITMAP hbmMask);
  154.  
  155. void         FAR PASCAL  SetAlgoAnimobSize(HANIMOB hAnimob,
  156.                                                     int nWidth,
  157.                                                     int nHeight);
  158.  
  159. void        FAR PASCAL  UpdateAnimZone(HDC hDC, HAZ hAZ);
  160.  
  161.  
  162.  
  163.  
  164. /******************************* Errors ************************************/
  165.  
  166.  
  167. enum WanimErrors {
  168.     NO_WANIM_ERROR = 0,    /* there was no error during last operation */
  169.     MDC_PAD_ERROR,            /* could not create a memory device context for
  170.                                     internal scratch pad */
  171.     MDC_ZONE_ERROR,        /* could not create a memory device context for
  172.                                     for animation zone */
  173.     MDC_ANIMOB_ERROR,        /* could not create a memory device context for
  174.                                     animobs */
  175.     RGN_PAD_ERROR,            /* could not create a rectangular clipping region */
  176.     BMP_TEMP_ERROR,        /* could not create a temporary bitmap */
  177.     BMP_PAD_ERROR,            /* could not create a bitmap for internal scratch
  178.                                     pad */
  179.     BMP_ZONE_ERROR,        /* could not create a bitmap for animation zone */
  180.     HAC_ALLOC_ERROR,        /* could not allocate memory for animation context */
  181.     HAZ_ALLOC_ERROR,        /* could not allocate memory for animation zone */
  182.     HANIMOB_ALLOC_ERROR,    /* could not allocate memory for animob */
  183.     PARENT_EXISTS_ERROR,    /* attempt to attach a non-orphan animob */
  184.     LOST_CHILD_ERROR,        /* child animob not assigned to a parent zone */
  185.     ORPHAN_ERROR,            /* child animob already an orphan.  Cannot detach */
  186.     ZONE_FULL_ERROR,        /* no more animob can be attached to this object */
  187.     MDC_MASK_ERROR,      /* could not create a memory device context for mask */
  188.     BMP_MASK_ERROR            /* could not create a memory bitmap for mask */
  189. };
  190.  
  191. #endif
  192.